﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
        Id="P3ToolsTab.SPExplorer"
        RegistrationId="0x01"
        RegistrationType="ContentType"
        RequireSiteAdministrator="TRUE"
        Rights="FullMask"
        Location="CommandUI.Ribbon">
        <CommandUIExtension>
            <CommandUIDefinitions>
                <CommandUIDefinition Location="Ribbon.Templates._children">
                    <GroupTemplate  Id="Ribbon.Templates.SPExplorerTemplate">
                        <Layout
                          Title="OneLargeTwoMedium"
                          LayoutTitle="OneLargeTwoMedium">
                            <Section  Alignment="Top" Type="OneRow">
                                <Row>
                                    <ControlRef  DisplayMode="Large" TemplateAlias="spexplorerTemplate" />
                                </Row>
                            </Section>
                        </Layout>
                    </GroupTemplate>
                </CommandUIDefinition>
                <CommandUIDefinition Location="Ribbon.P3ToolsTab.Scaling._children">
                    <MaxSize
                      Id="Ribbon.P3ToolsTab.Documents.MaxSize"
            Sequence="65"
            GroupId="Ribbon.P3ToolsTab.SPExplorer"
            Size="OneLargeTwoMedium" />

                </CommandUIDefinition>
                <CommandUIDefinition Location="Ribbon.P3ToolsTab.Groups._children">
                    <Group
                      Id="Ribbon.P3ToolsTab.SPExplorer"
                      Description="Opens the SPExploer with current object"
                      Title="Open With SPExplorer"
                      Sequence="52"
                      Template="Ribbon.Templates.SPExplorerTemplate">
                        <Controls  Id="Ribbon.P3ToolsTab.SPExplorer.Controls">
                            <Button
                               Id="Ribbon.P3ToolsTab.SPExplorer.SPExplorerButton"
                               Command="P3ToolsTab.SPExplorerCommand"
                               Sequence="15"
                               Description=""
                               LabelText="SPExplorer"
                               Image32by32="~sitecollection/Style Library/P3/settings_32.png"
                               TemplateAlias="spexplorerTemplate"/>
                        </Controls>

                    </Group>

                </CommandUIDefinition>

            </CommandUIDefinitions>
            <CommandUIHandlers>
                <CommandUIHandler
                    Command="P3ToolsTab.SPExplorerCommand"
                     CommandAction="javascript:InvokeSPExplorer(); "  />
            </CommandUIHandlers>

        </CommandUIExtension>

    </CustomAction>

    <CustomAction
   Location="ScriptLink"
   ScriptSrc ="~sitecollection/Style Library/P3/SPExplorer.js"/>
    
    

</Elements>
